/**
 * 
 */
package com.jie.eclipse.pan.swtitem.table;

import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import com.jie.eclipse.pan.data.BaseDataEntities;

/**
 * @author yanjie
 *
 */
public class PllTableContentProvider implements IStructuredContentProvider{

	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
	 */
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
	 */
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
	 */
	public Object[] getElements(Object element) {
		if(element instanceof BaseDataEntities){
			return ((BaseDataEntities)element).toArray();
		}else{
			return new Object[0];//否则,返回一个空数组
		}
	}

}
